<?php
//
//	file: includes/aucp/color_plug_topics.php
//	begin: 30/04/2007
//	$Author: christopher $
//	$Revision: 29 $
//	$Date: 2008-07-19 15:59:35 +0000 (Sat, 19 Jul 2008) $
//	license: http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
//
//	description: color plugs for class_topics

if (!defined('IN_PHPBB'))
{
	die("Hacking attempt");
}

class color_topics extends plug_ins
{
	function display($row, $switch)
	{
		global $template, $user, $colors;

		if ( ($row['topic_poster'] != ANONYMOUS) && isset($user->pool[ $row['topic_poster'] ]) )
		{
			$row['topic_first_user_session_time'] = $user->pool[ $row['topic_poster'] ]['user_session_time'];
		}
		if ( ($row['topic_last_poster'] != ANONYMOUS) && isset($user->pool[ $row['topic_last_poster'] ]) )
		{
			$row['topic_last_user_session_time'] = $user->pool[ $row['topic_last_poster'] ]['user_session_time'];
		}

		$row['topic_first_user_group_id'] = $user->pool[ $row['topic_poster'] ]['user_group_id'];
		$row['topic_last_user_group_id'] = $user->pool[ $row['topic_last_poster'] ]['user_group_id'];

		$template->assign_lastblock_vars($switch, array(
			'S_TOPIC_AUTHOR' => ( $row['topic_poster'] == ANONYMOUS ) ? $colors->get_user_color(GROUP_ANONYMOUS) : $colors->get_user_color($row['topic_first_user_group_id'], $row['topic_first_user_session_time']),
			'S_LAST_POST_AUTHOR' => $row['topic_moved_id'] ? '' : (( $row['topic_last_poster'] == ANONYMOUS ) ? $colors->get_user_color(GROUP_ANONYMOUS) : $colors->get_user_color($row['topic_last_user_group_id'], $row['topic_last_user_session_time'])),
		));

		return;
	}
}

?>